/****************************************/
/* Bottom.cpp			 				*/
/* Created on: Sep 4, 2011				*/
/* Copyright Playsoft 2011				*/
/* Released under GPL v2				*/
/****************************************/

#include "Bottom.h"

//----------------------------------------------------------------------

Bottom::Bottom() : currentFrame(0)
{
	frames[0] = load_bmp("data/bottom_1.bmp", default_palette );
	frames[1] = load_bmp("data/bottom_2.bmp", default_palette );
	frames[2] = load_bmp("data/bottom_3.bmp", default_palette );
	frames[3] = load_bmp("data/bottom_4.bmp", default_palette );
	frames[4] = load_bmp("data/bottom_5.bmp", default_palette );
	frames[5] = load_bmp("data/bottom_6.bmp", default_palette );
	frames[6] = load_bmp("data/bottom_7.bmp", default_palette );
	frames[7] = load_bmp("data/bottom_8.bmp", default_palette );
}

//----------------------------------------------------------------------

Bottom::~Bottom()
{
	destroy_bitmap(frames[0]);
	destroy_bitmap(frames[1]);
	destroy_bitmap(frames[2]);
	destroy_bitmap(frames[3]);
	destroy_bitmap(frames[4]);
	destroy_bitmap(frames[5]);
	destroy_bitmap(frames[6]);
	destroy_bitmap(frames[7]);
}

//----------------------------------------------------------------------

void Bottom::update()
{
	currentFrame = (currentFrame + 1) % 8;
}

//----------------------------------------------------------------------

void Bottom::render(BITMAP *buffer)
{
	masked_blit(frames[currentFrame], buffer, 0, 0, 0, SCREEN_H-60, 800, 86);
}

//----------------------------------------------------------------------
